//package com.amigo.online.provider.search.rocketmq.consumer;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import javax.annotation.Resource;
//
//import org.apache.solr.client.solrj.SolrClient;
//import org.apache.solr.common.SolrInputDocument;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
//import com.amigo.online.common.param.result.UserInfo;
//import com.amigo.online.provider.search.rocketmq.PushMessage;
//import com.amigo.online.provider.search.rocketmq.model.BaseMqSendModel;
//
//@Component("UserToSolrConsumer")
//public class UserToSolrConsumer implements PushMessage{
//	private static final Logger log = LoggerFactory.getLogger(UserToSolrConsumer.class);
//	@Resource(name="SolrClient_user") 
//	private SolrClient serverurl_user;
//	@Override
//	public void handleMessage(BaseMqSendModel baseMqSendModel) throws Exception {
//		log.info("user消费开始。。。。");
//		UserInfo userInfo = baseMqSendModel.getSendContentBean(UserInfo.class);
//		log.info("userInfo数据为"+userInfo);
//		//为文档添加域
//		List<SolrInputDocument> doc2=new ArrayList<SolrInputDocument>();
//		// 4、为文档添加域
//		SolrInputDocument document = new SolrInputDocument();
//		document.addField("id", userInfo.getId()==null?"":userInfo.getId()+"");//id
//		document.addField("account", userInfo.getAccount()==null?"":userInfo.getAccount()+"");//amigo账号
//		document.addField("nickname", userInfo.getNickname()==null?"":userInfo.getNickname()+"");//昵称
//		document.addField("sex", userInfo.getSex()==null?"":userInfo.getSex()+"");//性别
//		document.addField("email", userInfo.getEmail()==null?"":userInfo.getEmail()+"");//emai
//		document.addField("mobilephone", userInfo.getMobilephone()==null?"":userInfo.getMobilephone()+"");//手机号
//		//document.addField("twitter_open_id", userInfo.get+"");//twitterid
//		//document.addField("facebook_open_id", userInf+"");//
//		//document.addField("wechat_open_id", userInfo.getw+"");//推荐
//		document.addField("country", userInfo.getCountry()==null?"":userInfo.getCountry()+"");//国家
//		document.addField("city", userInfo.getCity()==null?"":userInfo.getCity()+"");//城市
//		document.addField("sign", userInfo.getSign()==null?"":userInfo.getSign()+"");//签名
//		document.addField("background", userInfo.getBackground()==null?"":userInfo.getBackground()+"");//背景图片
//		document.addField("avatar", userInfo.getAvatar()==null?"":userInfo.getAvatar()+"");//头像
//		document.addField("birthday",userInfo.getBirthday()==null?System.currentTimeMillis()/1000-569203200:userInfo.getBirthday());
//		doc2.add(document);
//		serverurl_user.add(doc2);
//		serverurl_user.commit();
//		log.info("user消费结束进入solr。。。。");
//	}
//
//}
